#include "title.h"

Title::Title()
{
	SetupImages();
}

Title::~Title()
{
	CleanupImages();
}

void Title::SetupImages()
{
	backgroundSprite = Iw2DCreateImageResource("titleBackground");
}

void Title::CleanupImages()
{
	if(backgroundSprite != NULL)
	{
		delete backgroundSprite;
		backgroundSprite = NULL;
	}
}

void Title::Render()
{
	Iw2DDrawImage(backgroundSprite, CIwSVec2(0, 0));
}

void Title::Update(int deltaTimeMs)
{
	UpdateInput(deltaTimeMs);
}

void Title::UpdateInput(int deltaTimeMs)
{
	s3ePointerUpdate();
    s3eKeyboardUpdate();

	if(s3ePointerGetState(S3E_POINTER_BUTTON_SELECT) & S3E_POINTER_STATE_DOWN)
    {
		gameMode = MODE_GAMEPLAY;
    }
}